<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {
	
	var $sidebardata = array('page'=>'login');

	public function index()
	{
		if (@isset($_POST['submit']))
		{
			$username = $_POST['username'];
			$password = $_POST['password'];
			if ($this->loginc->login($username,$password))
			{
				//TODO:jump
				echo '<script>url="/phpdb/index.php";window.location.href=url;</script>';
			}
		}
		$this->load->view('login');
	}
	
	public function logout()
	{
		$this->session->sess_destroy();
		$this->loginc->checkLogin();
	}
	
}

/* End of file user.php */
/* Location: ./application/controllers/user.php */